package com.ailiwu.www.ailiwu.views;

import android.content.Context;
import android.util.AttributeSet;

/**
 * Author:    Yyang
 * Version    V1.0
 * Date:      ${date}  ${time}.
 * Description:自定义ViewPager,重写了onMeasure方法计算宽高
 * Modification  History:
 * Date         	Author        		V
 * ersion        	Description
 * -----------------------------------------------------------------------------------
 * ${date}          Yyang                1.0                1.0
 * Why & What is modified:
 */
public class MyViewPager extends android.support.v4.view.ViewPager{
    public MyViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyViewPager(Context context) {
        this(context, null);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int height = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, height);
    }
}
